package luogu;

import java.math.BigInteger;
import java.util.Scanner;

public class Main22 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int P = sc.nextInt();

        //计算位数
        int digits = (int)( P * Math.log10(2)) + 1 ;
        System.out.println(digits);

        //计算最后500位
        BigInteger mod = BigInteger.TEN.pow(500);
        BigInteger result = BigInteger.ONE;
        BigInteger base = BigInteger.valueOf(2);
        int power = P;

        while (power>0){
            if (power%2==1){
                result = result.multiply(base).mod(mod);
            }
            base = base.multiply(base).mod(mod);
            power = power / 2;
        }

        result = result.subtract((BigInteger.ONE).mod(mod));
        String ansStr = String.format("%0500d", result);
        for (int i = 0; i < 10; i++) {
            System.out.println(ansStr.substring(i*50,(i+1)*50));
        }
    }
}
